<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of s_hopm</title>
  <meta name="keywords" content="s_hopm">
  <meta name="description" content="">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="../index.html">CO4OI</a> &gt; <a href="index.html">misc</a> &gt; s_hopm.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for CO4OI/misc&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>s_hopm
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong></strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function  u  = s_hopm( T, N, tolu ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">
   s_hopm computes the best rank-1 tensor approximation in the LS sense using the 
   Symmetric Higher-Order Power Method (S-HOPM) described in [1]

   INPUTS

   - T: Initial Tensor unfolded (cubic and supersymmetric)
   - N: dimension of one side of the cubic tensor T
   - tolu: tolerance on the relative variation of the solution. 
       The algorithm stops if
           | ||u(t)||_2 - ||u(t-1)||_2 | / ||u(t)||_2 &lt; tolu,
       where u(t) is the estimate of the solution at iteration t.

   OUTPUT
   
   - u: underpinning vector of the rank-1 tensor approximation of T.
   
 [1] E. Kofidis and P.A. Regalia, &quot;On the best rank-1 approximation of
 higher-order supersymmetric tensors&quot;, 2002, SIAM J. Matrix Anal. Appl,23, 863</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="sv.html" class="code" title="function w = sv( sol,N )">sv</a>	sv computes the eigenvalues of matrix C(sol)</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 
0002 <a name="_sub0" href="#_subfunctions" class="code">function  u  = s_hopm( T, N, tolu )</a>
0003 <span class="comment">%</span>
0004 <span class="comment">%   s_hopm computes the best rank-1 tensor approximation in the LS sense using the</span>
0005 <span class="comment">%   Symmetric Higher-Order Power Method (S-HOPM) described in [1]</span>
0006 <span class="comment">%</span>
0007 <span class="comment">%   INPUTS</span>
0008 <span class="comment">%</span>
0009 <span class="comment">%   - T: Initial Tensor unfolded (cubic and supersymmetric)</span>
0010 <span class="comment">%   - N: dimension of one side of the cubic tensor T</span>
0011 <span class="comment">%   - tolu: tolerance on the relative variation of the solution.</span>
0012 <span class="comment">%       The algorithm stops if</span>
0013 <span class="comment">%           | ||u(t)||_2 - ||u(t-1)||_2 | / ||u(t)||_2 &lt; tolu,</span>
0014 <span class="comment">%       where u(t) is the estimate of the solution at iteration t.</span>
0015 <span class="comment">%</span>
0016 <span class="comment">%   OUTPUT</span>
0017 <span class="comment">%</span>
0018 <span class="comment">%   - u: underpinning vector of the rank-1 tensor approximation of T.</span>
0019 <span class="comment">%</span>
0020 <span class="comment">% [1] E. Kofidis and P.A. Regalia, &quot;On the best rank-1 approximation of</span>
0021 <span class="comment">% higher-order supersymmetric tensors&quot;, 2002, SIAM J. Matrix Anal. Appl,23, 863</span>
0022 <span class="comment">%</span>
0023 
0024 
0025 <span class="comment">% compute initial point through higer order svd</span>
0026 [S U <a href="sv.html" class="code" title="function w = sv( sol,N )">sv</a> tol] = hosvd(reshape(T,N,N,N));
0027 u=U{1}(:,1);
0028 u=u./norm(u(:),2);
0029 uold=u;
0030 
0031 <span class="keyword">if</span> nargin &lt; 3
0032     tolu = 1e-3;
0033 <span class="keyword">end</span>
0034 iterS_HOPM=1;
0035 
0036 <span class="comment">%main loop</span>
0037 <span class="keyword">while</span>(1)
0038     
0039     T1=reshape(T,N,N*N);
0040     u=T1*kron(u,u);
0041     u=u./norm(u(:),2);
0042    
0043     <span class="keyword">if</span> (norm(uold(:)-u(:))/norm(uold(:)) &lt; tolu)
0044         <span class="keyword">break</span>;
0045     <span class="keyword">end</span>
0046     uold=u;
0047     iterS_HOPM=iterS_HOPM+1;
0048 <span class="keyword">end</span>
0049 
0050 <span class="keyword">end</span>
0051</pre></div>
<hr><address>Generated on Thu 18-Jul-2013 19:25:15 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>